package com.jvm123.api.api.controller

import org.springframework.web.bind.annotation.PostMapping
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RestController

/**
 *
 * @author yawn http://jvm123.com
 *     2019/10/10 14:38
 */
@RestController
@RequestMapping("url")
class UrlEncodeController {

    @PostMapping("encode")
    String encode(String s) {
        URLEncoder.newInstance().encode(s, "UTF-8")
    }

    @PostMapping("decode")
    String decode(String s) {
        URLDecoder.newInstance().decode(s, "UTF-8")
    }
}
